
module.exports = function($scope,$http,$q, $state, $stateParams,$resource,$modal){
 $scope.searchform = {};
   $scope.maxSize = 5;             //最多显示多少个按钮
    $scope.currentPage = 1;      //当前页码
    $scope.itemsPerPage = 10         //每页显示几条
 
  $scope.pageChanged = function () {
       
      $resource('api/ac/ggc/equipmentUserManageService/getPlaceByCompanyCode', {}, {}).
      save({}, function(res){
                if(res.errcode === 0 || res.errcode === 10003){
                  resstate=res.data.place;
              var para = {
                  pageNo:$scope.currentPage,
                  pageSize:$scope.itemsPerPage,
                  place:resstate
              };
        para = angular.extend($scope.searchform, para);

        $resource('/api/ac/ggc/equipmentManageDetailInformationService/findEquipmentHotelTotalInformationList', {}, {}).
      save(para, function(res){
                if(res.errcode === 0 || res.errcode === 10003){
                     for(var i=0;i<res.data.results.length;i++){
                           if(res.data.results[i].type==3){
                                  res.data.results.splice(i, 1);
                            }
                     }                 
                      $scope.userList=res.data.results;
                      $scope.totalItems = res.data.totalRecord;
                       
                }else{
                    alert(res.errmsg);
                }
            });
                }else{
                    alert(res.errmsg);
                }
            });     


    };
      $scope.pageChanged();


   
 $scope.information=function(info){

                 $state.go('app.equipmentMessageHotelDetailInformation',{'geid':info.code1});
                     
           
       }

}